package com.ggh.jinjilive.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.ggh.jinjilive.R;
import com.ggh.jinjilive.listener.AddOnClickListener;
import com.cy.dialog.BaseDialog;


/**
 * 提示
 */
public class PromptDialog extends BaseDialog {
    public TextView tv_prompt;

    public PromptDialog(Context context) {
        super(context);
    }

    public PromptDialog(Context context, int themeResId) {
        super(context, themeResId);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_prompt);
        animType(AnimInType.CENTER);
        canceledOnTouchOutside(false);
        tv_prompt = findViewById(R.id.tv_prompt);
        findViewById(R.id.tv_know).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
                if(null != addOnClickListener){
                    addOnClickListener.onSkipClicked("");
                }
            }
        });
    }

    /**
     * 提示语
     * @param prompt
     */
    public void promptLanguage(String prompt){
        if(null == tv_prompt){
            tv_prompt = findViewById(R.id.tv_prompt);
        }
        tv_prompt.setText(prompt);
    }


    private AddOnClickListener addOnClickListener;
    public void setAddOnClickListener(AddOnClickListener addOnClickListener){
        this.addOnClickListener = addOnClickListener;
    }
}
